<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>
<body>
  <div id="app">
    <span v-if="isUser">
      <label for="username">用户账户</label>
      <input type="text" id="username" placeholder="用户账号" key="123">
    </span>

    key可以避免vue本身的复用
    <span v-else>
      <label for="useremail">用户邮箱</label>
      <input type="text" id="useremail" placeholder="用户邮箱" key="456">
    </span>
      
    <button @click="isUser = !isUser">切换类型</button>
  </div>

  <script>
    const app = new Vue({
      el: '#app',
      data: {
        isUser: true
      },
      methods: {
       
      },
    })
  </script>
</body>
</html>